package com.ns.scs.collections.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ns.scs.collections.dto.CollectionsPageDto;
import com.ns.scs.collections.entry.CollectionsEntry;
import com.ns.scs.collections.mapper.CollectionsEntryMapper;
import com.ns.scs.collections.vo.CollectionsVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 参数业务实现
 *
 * @author lw
 * @since 2024/09/23
 */
@Service
@RequiredArgsConstructor
@Slf4j
public class CollectionsServiceImpl extends ServiceImpl<CollectionsEntryMapper, CollectionsEntry> implements ICollectionsService {

    private final CollectionsEntryMapper mapper;

    @Override
    public Page<CollectionsVO> getList(CollectionsPageDto dto) {
        return mapper.getList(dto, new Page<>(dto.getCurrent(), dto.getSize()));
    }

    @Override
    public List<CollectionsVO> getByType(String type) {
        return mapper.getByType(type);
    }


    @Override
    public List<CollectionsVO> getByResourceIdAndUidAndType(Long resourceId, Long uid, String type) {
        return mapper.getByResourceIdAndUidAndType(resourceId, uid, type);
    }
}
